package yt.kpool.network;

import android.util.Log;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/7/25.
 * 网络接口辅助类
 */

public class NetHelperNew {
    // public static final String URL = "http://soilcity.vicp.net";//IP地址
    //public static final String URL = "http://192.168.1.55:8899";//IP地址
    public static final String URL = "http://47.110.252.85:8011";//IP地址

    private static final String LOGIN = "/API/APP/Login";//用户登录
    private static final String MinerModelList = "/API/APP/MinerModelList";//首页列表数据
    private static final String CoinDropDownModelList = "/API/APP/CoinDropDownModelList";//首页顶部赛选条件
    private static final String ChildAccount = "/API/APP/ChildAccount";//子帐户列表
    private static final String CurrencyList = "/API/APP/CurrencyList";//右上角币种下拉
    private static final String GetOwnMinersList = "/API/APP/GetOwnMinersList";//矿工
    private static final String GetOwnMinersChart = "/API/APP/GetOwnMinersChart";//矿工图表
    private static final String PoolCoinList = "/API/APP/PoolCoinList";//主流币
    private static final String AddMinerRemark = "/API/APP/AddMinerRemark";//矿工添加方法
    private static final String PoolCoinDetails = "/API/APP/PoolCoinDetails";//矿池详细信息
    private static final String PoolAccountInfo = "/API/APP/PoolAccountInfo";//子帐号信息
    private static final String AddChildAccount = "/API/APP/AddChildAccount";//添加帐号
    private static final String UpdateChildAccounRemark = "/API/APP/UpdateChildAccounRemark";//修改子帐号备注
    private static final String ChildAccountAPIKey = "/API/APP/ChildAccountAPIKey";//查询APIKey
    private static final String UpdateChildAccountAPIKey = "/API/APP/UpdateChildAccountAPIKey";//生成APIKey
    private static final String ChangePassWordSendSmsCode = "/API/APP/ChangePassWordSendSmsCode";//修改密码发送验证码
    private static final String ChangePassWord = "/API/APP/ChangePassWord";//修改密码
    private static final String KeyLogin = "/API/APP/KeyLogin";//快速登录
    private static final String RetrievePassWordSendSmsCode = "/API/APP/RetrievePassWordSendSmsCode";//发送忘记密码验证码
    private static final String RetrievePassWordValidSmsCode = "/API/APP/RetrievePassWordValidSmsCode";//验证忘记密码验证码
    private static final String RetrievePassWord = "/API/APP/RetrievePassWord";//忘记密码
    private static final String RegSendSmsCode = "/API/APP/RegSendSmsCode";//发送注册短信验证码
    private static final String Reg = "/API/APP/Reg";//发送注册短信验证码
    public static final String Tutorial = "http://www.fkpool.top/tutorial/";//挖矿教程
    public static final String ChangeChildAccountAddressSendSmsCode = "/API/APP/ChangeChildAccountAddressSendSmsCode";//发送修改结算地址的验证码
    public static final String ChildAccountAddress = "/API/APP/ChildAccountAddress";//查询子帐户结算地址
    public static final String ChangeChildAccountAddress = "/API/APP/ChangeChildAccountAddress";//修改子帐户结算钱包地址

    private static final String PowCoinList = "/API/APP/PowCoinList";//Pow

    private static final String PoolProfitList = "/API/APP/PoolProfitList";//收益列表

    private static final String GetOfflineWarnsModel = "/API/APP/GetOfflineWarnsModel";//获取报警状态
    private static final String SetOfflineWarns = "/API/APP/SetOfflineWarns";//设置离线提醒
    private static final String PowCoinChart = "/API/APP/PowCoinChart";//Pow图表
    private static final String PowCoinDetails = "/API/APP/PowCoinDetails";//Pow币详情


    public static final String GetVersionInfo = "/API/APP/VersionInfo";//版本号

    public static final String MinerModelDetails = "/API/APP/MinerModelDetails";//矿机详情
    public static final String OwnMinerGroup = "/API/APP/OwnMinerGroup";//获得矿机分组列表
    public static final String AddMinerGroup = "/API/APP/AddMinerGroup";//添加修改分组
    public static final String DeleteMinerGroup = "/API/APP/DeleteMinerGroup";//删除分组
    public static final String MoveMinerGroup = "/API/APP/MoveMinerGroup";//移动矿机到分组
    public static final String DeleteMiners = "/API/APP/DeleteMiners";//删除矿机

    public static final String ReturnWalletList = "/API/APP/ReturnWalletList";//返点钱包列表
    public static final String SetReturnWalletAddress = "/API/APP/SetReturnWalletAddress";//设置钱包
    public static final String ProportionList = "/API/APP/ProportionList";//代理商收益列表
    public static final String ProportionStatementList = "/API/APP/ProportionStatementList";//返点结算记录
    public static final String PromotesList = "/API/APP/PromotesList";//推广链接
    public static final String GuestList = "/API/APP/GuestList";//我的客户列表
    public static final String GuestDetails = "/API/APP/GuestDetails";//客户详情
    public static final String ModifyUserProportion = "/API/APP/ModifyUserProportion";//修改客户分成模式
    public static final String ChildAccountForUserID = "/API/APP/ChildAccountForUserID";//用户下子帐户列表
    public static final String ChildAccountIDLogin = "/API/APP/ChildAccountIDLogin";//快速查看用户下子帐户快速查看登录接口接口
    public static final String ChildAccountAPIKeyList = "/API/APP/ChildAccountAPIKeyList";//APIKey列表
    public static final String AddChildAccountAPIKey = "/API/APP/AddChildAccountAPIKey";//添加APIKey
    public static final String DeleteChildAccountAPIKey = "/API/APP/DeleteChildAccountAPIKey";//删除APIKey
    public static final String UpdateChildAccounKeyRemark = "/API/APP/UpdateChildAccounKeyRemark";//修改APIKey备注
    private static final String CurrencyListForSetWalletAddress = "/API/APP/CurrencyListForSetWalletAddress";//设置提币地址右上角币种下拉
    private static final String OpenAPP = "/API/APP/OpenAPP";//打开app默认
    public static final String AgentList = "/API/APP/AgentList";//业务员我的代理列表
    public static final String AgentDetails = "/API/APP/AgentDetails";//代理详情
    public static final String LoginLogs = "/API/APP/LoginLogs";//登录日志
    public static final String SalaryList = "/API/APP/SalaryList";//我的工资
    public static final String ChildAccountProfitType = "/API/APP/ChildAccountProfitType";//查询子帐户结算方式
    public static final String ChangeChildAccountProfitType = "/API/APP/ChangeChildAccountProfitType";//修改子帐户结算方式
    public static final String ChildAccountProfitList = "/API/APP/ChildAccountProfitList";//BTC收益列表

    /**
     * 登录接口
     *
     * @param LoginName
     * @param LoginPass
     * @param callback
     */
    public static void login(String LoginName, String LoginPass, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("LoginName", LoginName);
        map.put("LoginPass", LoginPass);

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewLoginJson(URL + LOGIN, json, callback);
    }


    /**
     * 首页列表
     *
     * @param CurrencyCode
     * @param callback
     */
    public static void MinerModelList(String CurrencyCode, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyCode", CurrencyCode);
        String json = MyGson.getInstance().toJson(map);
        new HttpUtils().postNewJson(URL + MinerModelList, json, callback);
    }

    /**
     * 首页顶部赛选
     *
     * @param callback
     */
    public static void CoinDropDownModelList(HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        String json = MyGson.getInstance().toJson(map);
        new HttpUtils().postNewJson(URL + CoinDropDownModelList, json, callback);
    }

    /**
     * 子帐户
     *
     * @param CurrencyId 登录人ID
     * @param callback
     */
    public static void GetChildAccount(String CurrencyId, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyId", CurrencyId);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ChildAccount, json, callback);
    }

    /**
     * 后右上角币种
     *
     * @param callback
     */
    public static void GetCurrencyList(HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + CurrencyList, json, callback);
    }

    /**
     * 矿工
     *
     * @param CurrencyId     币种ID
     * @param ChildAccountID 子帐号ID
     * @param Search         搜索
     * @param State          状态 1在线 0离线 -1全部 -2失效
     * @param Sort           排序 鱼池从上到下是 1 2 3 4 5 6
     * @param callback
     */
    public static void GetOwnMinersList(int PageIndex, String CurrencyId, String ChildAccountID, String Search, String State, String Sort, String MinerGroupID, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("PageIndex", PageIndex + "");
        map.put("PageRows", "20");
        map.put("CurrencyId", CurrencyId);
        map.put("ChildAccountID", ChildAccountID);
        map.put("Search", Search);
        map.put("State", State);
        map.put("Sort", Sort);
        map.put("MinerGroupID", MinerGroupID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + GetOwnMinersList, json, callback);
    }

    /**
     * 矿工图表
     *
     * @param ChildAccountID 子帐号ID
     * @param CurrencyID     币种ID
     * @param Name           矿机名称
     * @param callback
     */
    public static void GetOwnMinersChart(String ChildAccountID, String CurrencyID, String Name, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();

        map.put("Name", Name);
        map.put("ChildAccountID", ChildAccountID);
        map.put("CurrencyID", CurrencyID);

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + GetOwnMinersChart, json, callback);
    }

    /**
     * 添加矿工的方法
     *
     * @param CurrencyId 币种ID
     * @param callback
     */
    public static void AddMinerRemark(String CurrencyId, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyId", CurrencyId);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + AddMinerRemark, json, callback);
    }

    /**
     * 矿池详细信息
     *
     * @param CurrencyId     币种ID
     * @param ChildAccountID 子帐号ID
     * @param callback
     */
    public static void PoolCoinDetails(String CurrencyId, String ChildAccountID, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyId", CurrencyId);
        map.put("ChildAccountID", ChildAccountID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + PoolCoinDetails, json, callback);
    }

    /**
     * 子帐号信息
     *
     * @param CurrencyId     币种ID
     * @param ChildAccountID 子帐号ID
     * @param callback
     */
    public static void PoolAccountInfo(String CurrencyId, String ChildAccountID, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyId", CurrencyId);
        map.put("ChildAccountID", ChildAccountID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + PoolAccountInfo, json, callback);
    }

    /**
     * 添加子帐户
     *
     * @param ChildAccountName 子帐户名称
     * @param Remark           备注
     * @param callback
     */
    public static void AddChildAccount(String ChildAccountName, String Remark, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ChildAccountName", ChildAccountName);
        map.put("Remark", Remark);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + AddChildAccount, json, callback);
    }

    /**
     * 修改子帐号备注
     *
     * @param ChildAccountID
     * @param Remark
     * @param callback
     */
    public static void UpdateChildAccounRemark(String ChildAccountID, String Remark, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ChildAccountID", ChildAccountID);
        map.put("Remark", Remark);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + UpdateChildAccounRemark, json, callback);
    }

    /**
     * 查询APIKey
     *
     * @param ChildAccountID 子帐号ID
     * @param callback
     */
    public static void ChildAccountAPIKey(String ChildAccountID, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ChildAccountID", ChildAccountID);

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ChildAccountAPIKey, json, callback);
    }

    /**
     * 生成APIKey
     *
     * @param ChildAccountID
     * @param callback
     */
    public static void UpdateChildAccountAPIKey(String ChildAccountID, String Remark, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ChildAccountID", ChildAccountID);
        map.put("Remark", Remark);

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + UpdateChildAccountAPIKey, json, callback);
    }

    /**
     * 修改密码
     *
     * @param SmsCode   短信验证码
     * @param LoginPass 新密码
     * @param callback
     */
    public static void ChangePassWord(String SmsCode, String LoginPass, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("SmsCode", SmsCode);
        map.put("LoginPass", LoginPass);

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ChangePassWord, json, callback);
    }

    /**
     * 快速查看登录接口
     *
     * @param Key
     * @param callback
     */
    public static void KeyLogin(String Key, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("Key", Key);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postKeyLoginJson(URL + KeyLogin, json, callback);
    }

    /**
     * 发送忘记密码验证码
     *
     * @param Phone
     * @param callback
     */
    public static void RetrievePassWordSendSmsCode(String Phone, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("Phone", Phone);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postKeyLoginJson(URL + RetrievePassWordSendSmsCode, json, callback);
    }

    /**
     * 验证忘记密码验证码
     *
     * @param Phone
     * @param SmsCode
     * @param callback
     */
    public static void RetrievePassWordValidSmsCode(String Phone, String SmsCode, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("Phone", Phone);
        map.put("SmsCode", SmsCode);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postKeyLoginJson(URL + RetrievePassWordValidSmsCode, json, callback);
    }

    /**
     * 忘记密码
     *
     * @param Phone
     * @param SmsCode
     * @param LoginPass
     * @param callback
     */
    public static void RetrievePassWord(String Phone, String SmsCode, String LoginPass, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("Phone", Phone);
        map.put("SmsCode", SmsCode);
        map.put("LoginPass", LoginPass);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postKeyLoginJson(URL + RetrievePassWord, json, callback);
    }

    /**
     * 发送注册短信验证码
     *
     * @param Phone
     * @param callback
     */
    public static void RegSendSmsCode(String Phone, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("Phone", Phone);

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postKeyLoginJson(URL + RegSendSmsCode, json, callback);
    }


    /**
     * 注册
     *
     * @param Phone
     * @param PromotesCode 邀请码
     * @param Name
     * @param LoginPass
     * @param SmsCode
     * @param callback
     */
    public static void Register(String Phone, String PromotesCode, String Name, String LoginPass, String SmsCode, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("Phone", Phone);
        map.put("PromotesCode", PromotesCode);
        map.put("Name", Name);
        map.put("LoginPass", LoginPass);
        map.put("SmsCode", SmsCode);

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postKeyLoginJson(URL + Reg, json, callback);
    }

    /**
     * 修改密码
     *
     * @param callback
     */
    public static void ChangePassWordSendSmsCode(HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ChangePassWordSendSmsCode, json, callback);
    }

    /**
     * 发送修改结算地址的验证码
     *
     * @param callback
     */
    public static void ChangeChildAccountAddressSendSmsCode(HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ChangeChildAccountAddressSendSmsCode, json, callback);
    }

    /**
     * 查询子帐户结算地址
     *
     * @param CurrencyId
     * @param ChildAccountID
     * @param callback
     */
    public static void ChildAccountAddress(String CurrencyId, String ChildAccountID, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyID", CurrencyId);
        map.put("ChildAccountID", ChildAccountID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ChildAccountAddress, json, callback);
    }

    /**
     * 修改子帐户结算钱包地址
     *
     * @param CurrencyId
     * @param ChildAccountID
     * @param Address
     * @param SmsCode
     * @param callback
     */
    public static void ChangeChildAccountAddress(String CurrencyId, String ChildAccountID, String Address, String SmsCode, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyID", CurrencyId);
        map.put("ChildAccountID", ChildAccountID);
        map.put("Address", Address);
        map.put("SmsCode", SmsCode);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ChangeChildAccountAddress, json, callback);
    }

    /**
     * 主流币
     *
     * @param callback
     */
    public static void PoolCoinList(HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        String json = MyGson.getInstance().toJson(map);
        new HttpUtils().postNewJson(URL + PoolCoinList, json, callback);
    }

    /**
     * Pow
     *
     * @param callback
     */
    public static void PowCoinList(HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        String json = MyGson.getInstance().toJson(map);
        new HttpUtils().postNewJson(URL + PowCoinList, json, callback);
    }

    /**
     * 收益列表
     *
     * @param CurrencyId
     * @param ChildAccountID
     * @param PageIndex
     * @param callback
     */
    public static void PoolProfitList(String CurrencyId, String ChildAccountID, String PageIndex, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyID", CurrencyId);
        map.put("ChildAccountID", ChildAccountID);
        map.put("PageIndex", PageIndex);
        map.put("PageRows", "20");
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + PoolProfitList, json, callback);
    }

    /**
     * 获取报警状态
     *
     * @param callback
     */
    public static void GetOfflineWarnsModel(HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        String json = MyGson.getInstance().toJson(map);
        new HttpUtils().postNewJson(URL + GetOfflineWarnsModel, json, callback);
    }

    /**
     * 设置离线报警提醒
     *
     * @param Enable
     * @param NoDisturbing
     * @param StartHour
     * @param StartMinute
     * @param EndHour
     * @param EndMinute
     * @param callback
     */
    public static void SetOfflineWarns(String Enable, String NoDisturbing, String StartHour, String StartMinute, String EndHour, String EndMinute, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("Enable", Enable);
        map.put("NoDisturbing", NoDisturbing);
        map.put("StartHour", StartHour);
        map.put("StartMinute", StartMinute);
        map.put("EndHour", EndHour);
        map.put("EndMinute", EndMinute);
        String json = MyGson.getInstance().toJson(map);
        Log.d("dddd", json);
        new HttpUtils().postNewJson(URL + SetOfflineWarns, json, callback);
    }

    /**
     * pow图表
     *
     * @param Code
     * @param Day
     * @param callback
     */
    public static void PowCoinChart(String Code, String Day, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("Code", Code);
        map.put("Day", Day);
        String json = MyGson.getInstance().toJson(map);
        new HttpUtils().postNewJson(URL + PowCoinChart, json, callback);
    }

    /**
     * pow详情
     *
     * @param CurrencyId
     * @param callback
     */
    public static void PowCoinDetails(String CurrencyId, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyId", CurrencyId);
        String json = MyGson.getInstance().toJson(map);
        Log.d("===", json);
        new HttpUtils().postNewJson(URL + PowCoinDetails, json, callback);
    }

    /**
     * 获得版本号
     *
     * @param callback
     */
    public static void GetVersionInfo(HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + GetVersionInfo, json, callback);
        //  new HttpUtils().postNewJson("http://300.fang101.com" + "/StaffAPI/StaffCommon/ttGetVersionInfo", json, callback);
    }

    /**
     * 矿机详情
     *
     * @param ID
     * @param callback
     */
    public static void MinerModelDetails(String ID, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ID", ID);
        String json = MyGson.getInstance().toJson(map);
        new HttpUtils().postNewJson(URL + MinerModelDetails, json, callback);
    }

    /**
     * 获得矿机分组列表
     *
     * @param CurrencyID
     * @param ChildAccountID
     * @param callback
     */
    public static void OwnMinerGroup(String CurrencyID, String ChildAccountID, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyID", CurrencyID);
        map.put("ChildAccountID", ChildAccountID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + OwnMinerGroup, json, callback);
    }

    /**
     * 添加修改分组
     *
     * @param ID             ID 为0添加 大于0修改
     * @param Name           名称
     * @param CurrencyID
     * @param ChildAccountID
     * @param callback
     */
    public static void AddMinerGroup(String ID, String Name, String CurrencyID, String ChildAccountID, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ID", ID);
        map.put("Name", Name);
        map.put("CurrencyID", CurrencyID);
        map.put("ChildAccountID", ChildAccountID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + AddMinerGroup, json, callback);
    }

    /**
     * 移动矿机到分组
     *
     * @param MinerGroupID
     * @param MinerNameList  矿机名称列表
     * @param CurrencyID
     * @param ChildAccountID
     * @param callback
     */
    public static void MoveMinerGroup(String MinerGroupID, List<String> MinerNameList, String CurrencyID, String ChildAccountID, HttpUtils.HttpCallback callback) {
        Map<String, Object> map = new HashMap<>();
        map.put("MinerGroupID", MinerGroupID);
        map.put("MinerNameList", MinerNameList);
        map.put("CurrencyID", CurrencyID);
        map.put("ChildAccountID", ChildAccountID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + MoveMinerGroup, json, callback);
    }


    /**
     * 代理商收益列表 返点查询
     * @param CurrencyID
     * @param BeginTime
     * @param EndTime
     * @param callback
     */
    public static void ProportionList(String CurrencyID, String BeginTime,String EndTime, HttpUtils.HttpCallback callback) {
        Map<String, Object> map = new HashMap<>();
        map.put("CurrencyID", CurrencyID);
        map.put("BeginTime", BeginTime);
        map.put("EndTime", EndTime);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ProportionList, json, callback);
    }

    /**
     * 删除分组
     *
     * @param ID
     * @param callback
     */
    public static void DeleteMinerGroup(String ID, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ID", ID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + DeleteMinerGroup, json, callback);
    }

    /**
     * 返点钱包列表
     * @param
     * @param callback
     */
    public static void ReturnWalletList(HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        String json = MyGson.getInstance().toJson(map);
        new HttpUtils().postNewJson(URL + ReturnWalletList, json, callback);
    }

    /**
     * 设置钱包地址
     * @param Address
     * @param CurrencyID
     * @param Remark
     * @param callback
     */
    public static void SetReturnWalletAddress(String Address,String CurrencyID,String Remark,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("Address", Address);
        map.put("CurrencyID", CurrencyID);
        map.put("Remark", Remark);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + SetReturnWalletAddress, json, callback);
    }


    public static void DeleteMiners(List<String> MinerNameList, String CurrencyID, String ChildAccountID, HttpUtils.HttpCallback callback) {
        Map<String, Object> map = new HashMap<>();

        map.put("MinerNameList", MinerNameList);
        map.put("CurrencyID", CurrencyID);
        map.put("ChildAccountID", ChildAccountID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + DeleteMiners, json, callback);
    }

    /**
     * 返点结算记录
     * @param CurrencyID
     * @param BeginTime
     * @param EndTime
     * @param PageIndex
     * @param callback
     */
    public static void ProportionStatementList(String CurrencyID,String BeginTime,String EndTime,String PageIndex,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyID", CurrencyID);
        map.put("BeginTime", BeginTime);
        map.put("EndTime", EndTime);
        map.put("PageIndex", PageIndex);
        map.put("PageSize", "10");
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ProportionStatementList, json, callback);
    }

    /**
     * 推广链接
     * @param callback
     */
    public static void PromotesList(HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        String json = MyGson.getInstance().toJson(map);
        new HttpUtils().postNewJson(URL + PromotesList, json, callback);
    }

    /**
     * 我的客户
     * @param CurrencyID 币种ID
     * @param PageIndex
     * @param callback
     */
    public static void GuestList(String CurrencyID,String PageIndex,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyID", CurrencyID);
        map.put("PageIndex", PageIndex);
        map.put("PageSize", "20");
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + GuestList, json, callback);
    }

    /**
     * 客户详情
     * @param CurrencyID
     * @param UserID
     * @param callback
     */
    public static void GuestDetails(String CurrencyID,String UserID,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyID", CurrencyID);
        map.put("UserID", UserID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + GuestDetails, json, callback);
    }

    /**
     * 修改客户分成模式
     * @param ProportionID
     * @param UserID
     * @param callback
     */
    public static void ModifyUserProportion(String ProportionID,String UserID,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ProportionID", ProportionID);
        map.put("UserID", UserID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ModifyUserProportion, json, callback);
    }

    /**
     * 用户下子帐户列表
     * @param CurrencyId
     * @param UserId
     * @param callback
     */
    public static void ChildAccountForUserID(String CurrencyId,String UserId,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyId", CurrencyId);
        map.put("UserId", UserId);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ChildAccountForUserID, json, callback);
    }

    /**
     * 快速查看用户下子帐户快速查看登录接口接口
     * @param ChildAccountID
     * @param callback
     */
    public static void ChildAccountIDLogin(String ChildAccountID, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ChildAccountID", ChildAccountID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postGuestChildLoginJson(URL + ChildAccountIDLogin, json, callback);
    }

    /**
     * APIKey列表
     * @param ChildAccountID
     * @param callback
     */
    public static void ChildAccountAPIKeyList(String ChildAccountID, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ChildAccountID", ChildAccountID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postGuestChildLoginJson(URL + ChildAccountAPIKeyList, json, callback);
    }

    /**
     * 添加APIKey
     * @param ChildAccountID
     * @param Remark
     * @param callback
     */
    public static void AddChildAccountAPIKey(String ChildAccountID, String Remark, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ChildAccountID", ChildAccountID);
        map.put("Remark", Remark);

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + AddChildAccountAPIKey, json, callback);
    }

    /**
     * 删除APIKey
     * @param ID
     * @param callback
     */
    public static void DeleteChildAccountAPIKey(String ID, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ID", ID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + DeleteChildAccountAPIKey, json, callback);
    }

    /**
     * 修改APIKey备注
     * @param ID
     * @param Remark
     * @param callback
     */
    public static void UpdateChildAccounKeyRemark(String ID,String Remark, HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("ID", ID);
        map.put("Remark", Remark);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + UpdateChildAccounKeyRemark, json, callback);
    }

    /**
     * 设置提币地址右上角币种下拉
     * @param callback
     */
    public static void GetPayCurrencyList(HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + CurrencyListForSetWalletAddress, json, callback);
    }

    /**
     * 打开app记录次数
     * @param callback
     */
    public static void OpenAPP(HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJsonMainToken(URL + OpenAPP, json, callback);
    }

    /**
     *  业务员 我的代理
     * @param CurrencyID
     * @param PageIndex
     * @param callback
     */
    public static void AgentList(String CurrencyID,String PageIndex,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyID", CurrencyID);
        map.put("PageIndex", PageIndex);
        map.put("PageSize", "20");
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + AgentList, json, callback);
    }

    /**
     * 代理全部客户详情
     * @param CurrencyID
     * @param UserID
     * @param callback
     */
    public static void AgentDetails(String CurrencyID,String UserID,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyID", CurrencyID);
        map.put("UserID", UserID);
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + AgentDetails, json, callback);
    }

    /**
     * 登录日志
     * @param UserID
     * @param PageIndex
     * @param callback
     */
    public static void LoginLogs(String UserID,String PageIndex,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("UserID", UserID);
        map.put("PageIndex", PageIndex);
        map.put("PageSize", "20");
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + LoginLogs, json, callback);
    }

    public static void SalaryList(String BeginTime,String EndTime,String CurrencyID,String PageIndex,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("BeginTime", BeginTime);
        map.put("EndTime", EndTime);
        map.put("CurrencyID", CurrencyID);
        map.put("PageIndex", PageIndex);
        map.put("PageSize", "20");
        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + SalaryList, json, callback);
    }

    /**
     * 查询子帐户结算方式
     * @param CurrencyID 币种ID
     * @param ChildAccountID 子帐号ID
     * @param callback
     */
    public static void ChildAccountProfitType(String CurrencyID,String ChildAccountID ,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyID", CurrencyID);
        map.put("ChildAccountID", ChildAccountID);

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ChildAccountProfitType, json, callback);
    }

    /**
     * 修改子帐户结算方式
     * @param CurrencyID
     * @param ChildAccountID
     * @param Name PPS或FPPS
     * @param callback
     */
    public static void ChangeChildAccountProfitType(String CurrencyID,String ChildAccountID,String Name ,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();
        map.put("CurrencyID", CurrencyID);
        map.put("ChildAccountID", ChildAccountID);
        map.put("Name", Name);

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", json);
        new HttpUtils().postNewJson(URL + ChangeChildAccountProfitType, json, callback);
    }

    /**
     * BTC收益列表
     * @param ChildAccountID
     * @param PageIndex
     * @param callback
     */
    public static void BtcChildAccountProfitList(String ChildAccountID,String PageIndex ,HttpUtils.HttpCallback callback) {
        Map<String, String> map = new HashMap<>();

        map.put("ChildAccountID", ChildAccountID);
        map.put("PageIndex", PageIndex);
        map.put("PageRows", "10");

        String json = MyGson.getInstance().toJson(map);
        Log.i("Json", "BTC收益列表:"+json);
        new HttpUtils().postNewJson(URL + ChildAccountProfitList, json, callback);
    }
}
